﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="plugins/layui/css/layui.css" rel="stylesheet" />
    <script src="js/jquery-3.1.1.min.js"></script>
    
</head>
<body>
    <form class="layui-form layui-form-pane" action="">
        <table>
            <tr>
                <td>
                    <label class="layui-form-label" style="height:66px; line-height:50px;">请输入分类</label>
                    <div class="layui-input-block">
                        <input name="classname" class="layui-input" type="text" placeholder="请输入" style="height:66px;" autocomplete="off" lay-verify="required">
                    </div>
                </td>
                <td><button class="layui-btn" lay-filter="tijiao" style="height:66px;" lay-submit="">立即提交</button></td>
            </tr>
        </table>
    </form>
    <script src="plugins/layui/layui.js"></script>
    <script src="ajax/main.js"></script>
    <script src="js/uuid.js"></script>
    <script>
            layui.use(['form'], function () {
                var form = layui.form()
                , layer = layui.layer;
                //自定义验证规则

                //监听提交
                form.on('submit(tijiao)', function (data) {
                    var field_id = new Array("classid", "classname", "filename");
                    var val = "'"+uuid(6, 16) + "','" + data.field["classname"] + "','newsclass'";
                    CJPlugin.execute("newsclass", val, "insert", "ExecuteHandler", field_id);
                    //CJPlugin.addClassRecord(v, "newsclass");
                    //return false;
                });
            });
    </script>

</body>
</html>